#pragma once
#include <vector>
#include <cstdint>
#include <cstddef> 

namespace linkfabric {
struct TLV {
    uint8_t tag;
    uint16_t length;
    std::vector<uint8_t> value;

    TLV(uint8_t t, const std::vector<uint8_t>& v);
    std::vector<uint8_t> encode() const;
    static TLV decode(const std::vector<uint8_t>& raw, size_t& offset);
};
}
